class Canvas  {
  constructor(w,h) {
    this.obj = wx.createCanvas()
    this.context2d = this.obj.getContext("2d")
    this.contextGL = this.obj.getContext("webgl")
  }
  setFillColor(name) {
    this.context2d.fillStyle = name
  }
  drawRect(x,y,w,h){
    this.context2d.fillRect(x,y,w,h)
  }
  setLineWidth(num) {
    this.context2d.lineWidth = num
  }
  setLineCap(str) {
    this.context2d.lineCap = str // "butt","round","square"
  }
}
export function newCanvas(w,h){
  return new Canvas(w,h)
}
/*
context . lineWidth [ = value ]
Returns the current line width.

Can be set, to change the line width. Values that are not finite values greater than zero are ignored.

context . lineCap [ = value ]
Returns the current line cap style.

Can be set, to change the line cap style.

The possible line cap styles are "butt", "round", and "square". Other values are ignored.

context . lineJoin [ = value ]
Returns the current line join style.

Can be set, to change the line join style.

The possible line join styles are "bevel", "round", and "miter". Other values are ignored.

context . miterLimit [ = value ]
Returns the current miter limit ratio.

Can be set, to change the miter limit ratio. Values that are not finite values greater than zero are ignored.

context . setLineDash(segments)
Sets the current line dash pattern (as used when stroking). The argument is an array of distances for which to alternately have the line on and the line off.

segments = context . getLineDash()
Returns a copy of the current line dash pattern. The array returned will always have an even number of entries (i.e. the pattern is normalized).

context . lineDashOffset [ = value ]
Returns the phase offset (in the same units as the line dash pattern).

Can be set, to change the phase offset. Values that are not finite values are ignored.

*/